Re: problems with pg_dump and pg_restore

Поиск
Список
Период
Сортировка
От admin@usachurch.com
Тема Re: problems with pg_dump and pg_restore
Дата
Msg-id p0611040abd8b3defd798@[192.168.123.110]
обсуждение исходный текст
Ответ на Re: problems with pg_dump and pg_restore  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
>  > pg_restore -U admin -C -d staging /home/postgres/staging-dump
>>  pg_restore: [archiver (db)] could not execute query: ERROR:  database
>>  "staging" already exists
>
>-C tells it to create (and then connect to) the target DB, rather than
>connect to an existing DB and restore into that.  So generally you want
>to say "-d template1" (or some other existing DB) when you use -C.

Tom,

But if I first "dropdb -U admin staging", and then issue:
pg_restore -U admin -C -d staging /home/postgres/staging-dump

I get the error:
pg_restore: [archiver (db)] connection to database "staging" failed:
FATAL:  database "staging" does not exist

Yet the docs state that the above command should Create the database
named by the "-d staging"
part of the command.  I'm confused as to why that doesn't work.  I
also am not sure what the
template1 and template0 are there for.

Regards,
Devin

В списке pgsql-admin по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [Fwd: Re: Question about pgfsck]
Следующее
От: "Simon Riggs"
Дата:
Сообщение: Re: Multiple WALs for PITR ?